/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn;

import java.text.NumberFormat;

/**
 * <p>Project: javase - T1
 * <p>Powered by webrx On 2021-12-21 17:25:35
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class T1 {
    public static void main(String[] args) {
        double d = 0.1234;
        //System.out.printf("%.2f", d);
        NumberFormat nf = NumberFormat.getNumberInstance();
        nf.setMaximumFractionDigits(2);

        System.out.println(nf.format(d));
    }
}
